<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>支付宝登录</title>
		<style>
			body {
				display: flex;
				justify-content: center;
				align-items: center;
				text-align: center;
				height: 90vh;
				font-size: .9375rem;
			}

			content {
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
			}

			.logo_img {
				width: 6.875rem;
				height: 6.875rem;
				margin-bottom: .625rem;
			}

			#box {
				width: 60%;
				height: 2rem;
				text-align: center;
				line-height: 2rem;
				border-radius: 20px;
				background-color: rgb(23, 120, 194);
				color: white;
				margin: .9375rem auto;
				text-decoration: line-through；
			}
            
            #box:hover{
				opacity: .7;
			}
            
			.desc {
				font-size: .3125rem;
				color: gray;
			}
		</style>
	</head>

	<body>
		<content>
			<img src="./logo.png" class="logo_img">
			<div id='box' onClick="onBack()"> 返回app</div>
			<div class="desc">您已授权登录，请点击返回app</div>
		</content>
		<script type="text/javascript">
			function getQueryVariable(variable) {
				var query = window.location.search.substring(1);
				var vars = query.split("&");
				for (var i = 0; i < vars.length; i++) {
					var pair = vars[i].split("=");
					if (pair[0] == variable) {
						return pair[1];
					}
				}
				return (false);
			}

			function onBack() {
				var code = getQueryVariable("auth_code");
				//hbuilder xianxun
				let href = "xianxun://?" + encodeURIComponent(JSON.stringify({
					"code": code
				}))
				window.location.href = href
			}
			window.onload = onBack()
		</script>
	</body>

</html>
